package com.qst.action.PersonalityDimension;

import com.qst.BaseServlet;
import com.qst.RequestUtil;
import com.qst.WebUtil;
import com.qst.entity.PersonalityDimension;
import com.qst.service.DimensionService;
import com.qst.service.impl.ServiceFactory;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

//@WebServlet("/dimension/edit.action")
public class EditServlet extends BaseServlet {

    private DimensionService dimensionService = ServiceFactory.getService(DimensionService.class);

    @Override
    protected void doAction(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        PersonalityDimension kp = dimensionService.findDimensionById(RequestUtil.getInt(req, "id"));
        req.setAttribute("dimension", kp);
        WebUtil.forward(req, resp, "/dimension/edit.jsp");
    }
}
